<template>
    <div class="container">
            <el-card class="table_tool_bar_wrap mb10" shadow="never">
                <div class="base_wrap mb10 mt10">
                    <div class="left">
                        <i class="el-icon-tickets" style="margin-right: 10px;"></i>
                        详情{{menu.name?' - '+menu.name:''}}
                    </div>
                </div>
            </el-card>

            <!-- 表格 -->
            <el-table
                ref="table"
                size="medium"
                empty-text="暂无数据"
                element-loading-text="给我一点时间"
                fit border highlight-current-row
                :stripe="stripe"
                v-loading="loadingData"
                :data="dataList"
                @selection-change="handleSelection">

                <el-table-column label="分类名称" prop="name" width="200"/>
                <el-table-column label="层级" prop="level" align="center"/>
                <el-table-column label="显示" prop="status" align="center">
                    <template slot-scope="scope">
                    <i style="color:#67C23A" class="el-icon-success" v-if="scope.row.status==1"></i>
                    <i class="el-icon-error" v-else></i>
                    </template>
                </el-table-column>
                <el-table-column label="排序" prop="sort" align="center"/>
                <el-table-column label="图标地址" prop="icon" align="center"/>
                <el-table-column label="计量单位" prop="productUnit" align="center"/>
                <el-table-column label="商品数量" prop="productCount" align="center"/>

            </el-table>

    </div>
</template>

<script>
import TableMixin from '@/mixin/TableMixin'
import TablePagination from '@/views/components/table/table-pagination'
import AddOrUpdate from './add-or-update-dialog'
export default {
    mixins: [TableMixin],
    components: {
        TablePagination,
        AddOrUpdate
    },

    props: {
        menu: {
            type: Object,
            default: {}
        }
    },

    data() {
        return {
            dataList: [],
            total: 0,
            loadingData: false,
            addOrUpdateVisible: false,
            selectionRows: [],
            searchFlag: true,
            searchForm: {
                page: 1,
                limit: 10,
                sortColumns: null,
                sortType: null,
                keyword: null,
                menuId: null
            }
        }
    },

    watch: {
        menu(val) {
            this.dataList = []
            this.dataList.push(val)
        }
    },

    created() {
    },

    mounted() {
        this.$nextTick(() => {
        })
    },

    methods: {

    }

}
</script>

<style lang="scss" scoped>

</style>
